:root {
    --primary-color: #3182ce;
    --wechat-color: #07C160;
    --zhihu-color: #0066FF;
    --toutiao-color: #F04142;
    --xiaohongshu-color: #FF2E4D;
    --code-bg: #f8fafc;
    --blockquote-bg: #f8fafc;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    display: flex;
    flex-direction: column;
    width: 98%;
    height: 98%;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 头部样式 */
.header {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #eaeaea;
    background-color: #ffffff;
}

.logo {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eaeaea;
}

.logo i {
    margin-right: 8px;
    color: #4a6ee0;
    font-size: 22px;
}

/* 工具栏样式 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background-color: #fafafa;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-btn {
    padding: 6px 10px;
    background-color: transparent;
    color: #555;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.tool-btn:hover {
    background-color: #f0f0f0;
    color: #4a6ee0;
}

.primary-btn {
    padding: 8px 16px;
    background-color: #3182ce;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.primary-btn:hover {
    background-color: #2c5282;
    transform: translateY(-1px);
}

.icon-btn {
    padding: 8px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    color: #4a5568;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #f8fafc;
    color: #3182ce;
    border-color: #3182ce;
}

.styled-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: white;
    color: #4a5568;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
    transition: all 0.2s ease;
}

.styled-select:hover {
    border-color: #3182ce;
}

.small-btn {
    padding: 6px 12px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #4a5568;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.small-btn:hover {
    background-color: #edf2f7;
    color: #3182ce;
    border-color: #3182ce;
}

/* 内容区域样式 */
.content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #ffffff;
}

/* 编辑区样式 */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-right: 1px solid #edf2f7;
}

/* 编辑区标题栏样式 */
.editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #ffffff;
    border-bottom: 1px solid #edf2f7;
}

.editor-header span {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
    white-space: nowrap;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    margin: 0 12px;
    background: #f8fafc;
    padding: 6px;
    border-radius: 8px;
}

.editor-toolbar .tool-btn {
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-toolbar .tool-btn:hover {
    background: #edf2f7;
    color: #3182ce;
}

#editor {
    flex: 1;
    padding: 20px;
    border: none;
    outline: none;
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    font-family: 'Consolas', 'Microsoft YaHei', monospace;
    background-color: #ffffff;
    color: #2d3748;
}

/* 预览区样式 */
.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-left: 1px solid #edf2f7;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #ffffff;
    border-bottom: 1px solid #edf2f7;
}

.preview-header .title-section span {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#preview {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: white;
    color: #2d3748;
    line-height: 1.7;
}

/* 手机预览模式 */
.phone-frame {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #f0f0f0;
    overflow: hidden;
}

.phone-device {
    width: 375px;
    height: 667px;
    background-color: #111;
    border-radius: 36px;
    padding: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2), 
                inset 0 0 0 2px #444, 
                inset 0 0 0 6px #222;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 30px;
    background-color: #111;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 10;
}

.phone-notch::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background-color: #444;
    border-radius: 50%;
}

.phone-screen {
    flex: 1;
    background-color: white;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.phone-status-bar {
    height: 30px;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    color: #333;
    border-bottom: 1px solid #eee;
}

.phone-time {
    font-weight: 600;
}

.phone-icons {
    display: flex;
    gap: 5px;
}

.phone-icons i {
    font-size: 12px;
}

.phone-content {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.preview.mobile {
    width: 100%;
    height: 100%;
    font-size: 14px;
    line-height: 1.5;
    padding: 15px;
    overflow-x: hidden;
    overflow-y: auto;
}

.phone-home-indicator {
    height: 5px;
    background-color: #ddd;
    width: 40%;
    margin: 8px auto;
    border-radius: 3px;
}

@media (max-height: 700px) {
    .phone-device {
        height: 550px;
    }
}

/* 状态栏样式 */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background-color: #f8fafc;
    border-top: 1px solid #edf2f7;
}

.status-info {
    display: flex;
    gap: 16px;
    color: #718096;
    font-size: 13px;
}

.status-actions {
    display: flex;
    gap: 10px;
}

/* 提示消息样式 */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background-color: #2d3748;
    color: white;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.toast.show {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content {
        flex-direction: column;
    }
    
    .editor-container, .preview-container {
        flex: none;
        height: 50%;
    }
    
    .editor-container {
        border-right: none;
        border-bottom: 1px solid #eaeaea;
    }
}

/* 美化预览区域的Markdown渲染样式 */
#preview h1, #preview h2, #preview h3, #preview h4, #preview h5, #preview h6 {
    color: #2d3748;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
}

#preview h1 {
    font-size: 2em;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 0.3em;
}

#preview h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 0.3em;
}

#preview p {
    margin: 1em 0;
    line-height: 1.7;
}

#preview blockquote {
    padding: 0.8em 1em;
    border-left: 4px solid #3182ce;
    background-color: #f8fafc;
    margin: 1em 0;
    color: #4a5568;
    border-radius: 0 4px 4px 0;
}

#preview code {
    background-color: #f8fafc;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: Consolas, monospace;
    font-size: 0.9em;
    color: #3182ce;
}

#preview pre {
    background-color: #f8fafc;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #edf2f7;
}

#preview pre code {
    background-color: transparent;
    padding: 0;
    color: #2d3748;
}

#preview ul, #preview ol {
    padding-left: 2em;
    margin: 1em 0;
}

#preview img {
    max-width: 100%;
    margin: 1em 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#preview table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

#preview table th, #preview table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
}

#preview table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

#preview table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 平台特定样式 */
/* 微信公众号样式 */
.preview.wechat {
    --primary-color: var(--wechat-color);
    --code-bg: #f8f8f8;
    --blockquote-bg: #f8f8f8;
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #333;
    line-height: 1.75;
    background-color: #fff;
}

.preview.wechat h1, .preview.wechat h2, .preview.wechat h3, .preview.wechat h4, .preview.wechat h5, .preview.wechat h6 {
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.preview.wechat h1 {
    font-size: 1.8em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.preview.wechat h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.preview.wechat h3 {
    font-size: 1.3em;
}

.preview.wechat h4 {
    font-size: 1.2em;
}

.preview.wechat p {
    margin: 1em 0;
    color: #333;
}

.preview.wechat a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
}

.preview.wechat blockquote {
    padding: 0.5em 1em;
    border-left: 4px solid var(--primary-color);
    background-color: var(--blockquote-bg);
    margin: 1em 0;
    color: #666;
}

.preview.wechat code {
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: Consolas, monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

.preview.wechat pre {
    background-color: var(--code-bg);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    border: 1px solid #eee;
}

.preview.wechat pre code {
    background-color: transparent;
    padding: 0;
    color: #333;
}

.preview.wechat ul, .preview.wechat ol {
    padding-left: 2em;
    margin: 1em 0;
}

.preview.wechat ul li, .preview.wechat ol li {
    margin-bottom: 0.5em;
    color: #333;
}

.preview.wechat img {
    max-width: 100%;
    margin: 1em 0;
    border-radius: 5px;
}

.preview.wechat table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.preview.wechat table th, .preview.wechat table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
}

.preview.wechat table th {
    background-color: var(--code-bg);
    font-weight: 600;
    color: var(--primary-color);
}

.preview.wechat table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.preview.wechat hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 1.5em 0;
}

.preview.wechat strong {
    color: var(--primary-color);
    font-weight: bold;
}

.preview.wechat em {
    color: #666;
    font-style: italic;
}

/* 知乎样式 */
.preview.zhihu {
    --primary-color: var(--zhihu-color);
    --code-bg: rgba(0, 102, 255, 0.1);
    --blockquote-bg: #f6f6f6;
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #333;
    line-height: 1.75;
    background-color: #fff;
}

.preview.zhihu h1, .preview.zhihu h2, .preview.zhihu h3, .preview.zhihu h4, .preview.zhihu h5, .preview.zhihu h6 {
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.preview.zhihu blockquote {
    padding: 0.5em 1em;
    border-left: 4px solid var(--primary-color);
    background-color: var(--blockquote-bg);
    margin: 1em 0;
    color: #555;
}

.preview.zhihu code {
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: Consolas, monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

.preview.zhihu a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 今日头条样式 */
.preview.toutiao {
    --primary-color: var(--toutiao-color);
    --code-bg: #f5f5f5;
    --blockquote-bg: #f8f8f8;
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #333;
    line-height: 1.75;
    background-color: #fff;
}

.preview.toutiao h1, .preview.toutiao h2, .preview.toutiao h3, .preview.toutiao h4, .preview.toutiao h5, .preview.toutiao h6 {
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.preview.toutiao blockquote {
    padding: 0.5em 1em;
    border-left: 4px solid var(--primary-color);
    background-color: var(--blockquote-bg);
    margin: 1em 0;
    color: #555;
}

.preview.toutiao a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 小红书样式 */
.preview.xiaohongshu {
    --primary-color: var(--xiaohongshu-color);
    --code-bg: #fff5f5;
    --blockquote-bg: #fff9f9;
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #333;
    line-height: 1.75;
    background-color: #fff;
}

.preview.xiaohongshu h1, .preview.xiaohongshu h2, .preview.xiaohongshu h3, .preview.xiaohongshu h4, .preview.xiaohongshu h5, .preview.xiaohongshu h6 {
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.preview.xiaohongshu blockquote {
    padding: 0.5em 1em;
    border-left: 4px solid var(--primary-color);
    background-color: var(--blockquote-bg);
    margin: 1em 0;
    color: #555;
}

.preview.xiaohongshu a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 添加滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}